package com.util;

import com.alibaba.fastjson.JSONObject;
import com.model.dto.SuperviseDTO.Search.BaseSearch;

public class LocationUtil {

    public static boolean filterLocation(JSONObject obj, BaseSearch base) {
        if (base.getCity() != null) {
            String city = obj!= null? obj.getString("city"): null;
            if (!base.getCity().equals(city)) {
                return false;
            }
        }
        if (base.getProvince() != null) {
            String province = obj!=null?obj.getString("province"):null;
            if(!base.getProvince().equals(province)){
                return false;
            }
        }
        return true;
    }
}
